//
// Created by Administrator on 2021/1/4 0004.
//

#include <jni.h>
#include "static_method_access.h"

JNIEXPORT void JNICALL
Java_com_yangyongfeng_JNI_1library_StaticMethodAccess_methodAccess(JNIEnv *env, jobject obj,  jint err_code)
{
    jclass  cls = NULL;
    jmethodID  method_id = NULL;

    cls = (*env).GetObjectClass(obj);
    if (cls == NULL){
        return;
    }

    method_id = (*env).GetStaticMethodID(cls,"callback","(I)V");
    if (method_id == NULL){
        return;
    }

    (*env).CallStaticVoidMethod(cls,method_id,0);
    return;
}